package com.wuming.house.service;

import com.wuming.house.core.BusinessException;
import com.wuming.house.model.Secondhouse;

import java.util.List;

public interface SecondhouseService {
    /**
     * 保存房产信息
     *
     * @param house 房产信息
     * @throws BusinessException
     */
    void saveSecondhouse(Secondhouse house) throws BusinessException;

    /**
     * 修改房产信息
     *
     * @param house 房产信息
     * @throws BusinessException
     */
    void modifySecondhouse(Secondhouse house) throws BusinessException;

    /**
     * 删除楼盘信息
     *
     * @param id 楼盘id
     * @throws BusinessException
     */
    void removeSecondhouseById(Long id) throws BusinessException;

    /**
     * 根据id查询房产
     *
     * @param id 房产id
     * @return 房产信息
     * @throws BusinessException
     */
    Secondhouse getSecondhouseById(Long id) throws BusinessException;

    /**
     * 根据分类查询所有的二手房
     *
     * @param houseDesc 二手房简介
     * @param area      区域
     * @param price     总价
     * @param layout    户型
     * @throws BusinessException
     */
    List<Secondhouse> getAllSecondhouse(String houseDesc, String area, String price, String layout) throws BusinessException;


    /**
     * 根据楼盘名称查询楼盘信息
     *
     * @param houseName 楼盘名称
     * @param pageIndex
     * @param pageSize
     * @return 微信用户
     */
    List<Secondhouse> getSecondhouseByPage(String houseName, int pageIndex, int pageSize) throws BusinessException;

    /**
     * 查询总数
     *
     * @param name 楼盘名称
     * @return
     */
    int getTotal(String name) throws BusinessException;

    List<Secondhouse> getSecondhouseByMember(Integer memberId,String houseName,int pageIndex,int pageSize) throws BusinessException;

    int getTotalByMember(Integer memberId,String houseName) throws BusinessException;
}
